<template>
  <div style="width:100%;height: 100%;background-color: rgb(255, 255, 255);">


      <div style="display:flex;width: 100%;">
          <div style="width:90%;">
              <h2>企业基本信息</h2>
          </div>
          <div v-if="btn" class="ok">
              <a-button @click="edit()" type="primary">修改</a-button>
          </div>
          <div v-if="!btn" style="display:flex" class="ok">
              <a-button @click="save()" type="primary">保存</a-button>
              <a-button style="margin-left:10%" @click="edit()" type="primary">取消</a-button>
          </div>
      </div>
       <div>


          <el-form ref="form" :model="form" style="width:100%;">

              <div style="display:flex;width: 100%;" :span="24">
                  <el-form-item label="统一社会信用代码:" style="display:flex;width:10%;background-color: rgb(243, 243, 243);">
                  </el-form-item>
                  <el-input :disabled="btn" style="width:500px" v-model="form.QYJBXX.shehuixinyongdaima"></el-input>
                  <el-form-item label="企业名称:"
                      style="display:flex;margin-left: 4%;width:10%;background-color: rgb(243, 243, 243);">
                  </el-form-item>
                  <el-input :disabled="btn" style="width:500px" v-model="form.QYJBXX.qiyemingcheng"></el-input>
              </div>

              <div style="display:flex;width: 100%;">
                  <el-form-item label="注册地址:" style="display:flex;;width:10%;background-color: rgb(243, 243, 243);">
                  </el-form-item>
                  <el-input :disabled="btn" style="width:500px" v-model="form.QYJBXX.zhucedizhi"></el-input>
                  <el-form-item label="生产经营场所:"
                      style="display:flex;margin-left: 4%;width:10%;background-color: rgb(243, 243, 243);">
                  </el-form-item>
                  <el-input :disabled="btn" style="width:500px" v-model="form.QYJBXX.shengchanjingyingchangsuo"></el-input>

              </div>


              <div style="display:flex;">
                  <el-form-item label="行政区划:" style="display:flex;width:10%;background-color: rgb(243, 243, 243);">

                  </el-form-item>
                  <el-input :disabled="btn" style="width:500px" v-model="form.QYJBXX.xingzhengquhua"></el-input>
                  <el-form-item label="行业类别:"
                      style="display:flex;margin-left: 4%;width:10%;background-color: rgb(243, 243, 243);">

                  </el-form-item>
                  <el-input :disabled="btn" style="width:500px" v-model="form.QYJBXX.xingzhengleibie"></el-input>

              </div>

              <div style="display:flex;">
                  <el-form-item label="行业代码:" style="display:flex;width:10%;background-color: rgb(243, 243, 243);">

                  </el-form-item>
                  <el-input :disabled="btn" style="width:500px" v-model="form.QYJBXX.hangyedaima"></el-input>
                  <el-form-item label="生产经营场所经度:"
                      style="display:flex;margin-left: 4%;width:10%;background-color: rgb(243, 243, 243);">
                  </el-form-item>
                  <el-input :disabled="btn" style="width:500px" v-model="form.QYJBXX.shengchanjingyingchangsuojingdu"></el-input>
              </div>

              <div style="display:flex;">
                  <el-form-item label="生产经营场所纬度:" style="display:flex;width:10%;background-color: rgb(243, 243, 243);">
                  </el-form-item>
                  <el-input :disabled="btn" style="width:500px" v-model="form.QYJBXX.shengchanjingyingchangsuoweidu"></el-input>
                  <el-form-item label="管理类别:"
                      style="display:flex;margin-left: 4%;width:10%;background-color: rgb(243, 243, 243);">
                  </el-form-item>
                  <el-input :disabled="btn" style="width:500px" v-model="form.QYJBXX.guanlileibie"></el-input>
              </div>

              <div style="display:flex;">
                  <el-form-item label="法人代表:" style="display:flex;width:10%;background-color: rgb(243, 243, 243);">
                  </el-form-item>
                  <el-input :disabled="btn" style="width:500px" v-model="form.QYJBXX.farendaibiao"></el-input>
                  <el-form-item label="联系电话:"
                      style="display:flex;margin-left: 4%;width:10%;background-color: rgb(243, 243, 243);">
                  </el-form-item>
                  <el-input :disabled="btn" style="width:500px" v-model="form.QYJBXX.lianxidianhua"></el-input>
              </div>
          </el-form>
      </div>
  </div>
   
</template>
<script>
import { httpAction, getAction, putAction } from '@/api/manage'
export default {
  created() {
      getAction(this.url.get).then((res) => {
          if (res.success) {
              this.form.QYJBXX = res.result.records[0]
          }
      });
  },
  data() {
      return {
          form: {
              QYJBXX: [ ],
          },
          url: {
              get: "/yzd_jichuxinxi/yzqQiyexinxi/list",
              put: "/yzd_jichuxinxi/yzqQiyexinxi/edit"
          },
          btn: true
      }
  },
  methods: {
      edit() {
          this.btn = !this.btn
      },
      save() {
          putAction(this.url.put, this.form.QYJBXX).then((res) => {
              if (res.success) {
                  alert("保存成功")
                  this.btn = !this.btn
              }
          });
      }
  }
}
</script>
<style lang="less" scoped>
.flex-row {
  background-color: red;
}

.plan {
  display: flex;
  width: auto;

}
</style>
